package com.youchuang.action.main;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;
import com.youchuang.action.BaseAction;
import com.youchuang.bean.Bulltion;
import com.youchuang.service.MainService;

/**
 * 根据id获得指定的快报信息
 * 
 * @author Administrator
 *
 */
@Namespace(value = "/main")
@ParentPackage("shopping-default")
public class OneBulltionAction extends BaseAction {
	private Logger logger = Logger.getLogger(OneBulltionAction.class.getSimpleName());
	private Bulltion bull;
	private String id;

	@Resource
	private MainService mainService;

	@Action(value = "oneBulltion", results = {
			@Result(name = ActionSupport.SUCCESS, location = "/WEB-INF/jsp/main/bulletinContext.jsp") })
	public String execute() throws Exception {
		logger.info("excetion is execute");

		bull = mainService.findBulltionById(id);

		return ActionSupport.SUCCESS;
	}

	public Bulltion getBull() {
		return bull;
	}

	public void setBull(Bulltion bull) {
		this.bull = bull;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
}
